<h1>New person</h1>

<%= error_messages_for :person %>

<% form_for(@person) do |f| %>
  <p>
    <b>First name</b><br />
    <%= f.text_field :first_name %>
  </p>

  <p>
    <b>Last name</b><br />
    <%= f.text_field :last_name %>
  </p>

  <p>
    <b>Date of birth</b><br />
    <%= f.datetime_select :date_of_birth, {:start_year => 1918, :end_year => Time.now.year} %>
  </p>
  
  <p>
  <% from_time = Time.now %>
  <%= distance_of_time_in_words(from_time, from_time + 10.minutes, true) %>
  </p>


  <p>
  <% my_time = Time.today + 6.days %>
  <%= select_date(my_time) %>
  </p>


  <p>
  <% my_time = Time.now + 6.days %>
  <%= select_datetime(my_time, :prefix => 'hey') %>
  </p>
  
  <p>
    <b>Country</b><br />
    <%= f.text_field :country_id %>
  </p>

  <p>
    <b>Favorite planet</b><br />
    <%= f.text_field :favorite_planet_id %>
  </p>

  <p>
    <%= f.submit "Create" %>
  </p>
<% end %>

<%= link_to 'Back', people_path %>
